package ldkxingzhe.ldkxingzhedemo.menu;

import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;

import ldkxingzhe.ldkxingzhedemo.menu.slidingmenu.app.SlidingActivity;

/**
 * Created by ke on 15-10-3.
 */
public class SlidingMenuDemoActivity extends SlidingActivity{

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        FrameLayout layout = new FrameLayout(this);
        TextView textView = new TextView(this);
        textView.setText("This is test for sliding menu");
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.gravity = Gravity.CENTER;
        layout.addView(textView, params);
        layout.setBackgroundColor(Color.GREEN);
        setContentView(layout);

        FrameLayout frameLayout = new FrameLayout(this);
        TextView textView1 = new TextView(this);
        textView1.setText("This is the menu");
        FrameLayout.LayoutParams params1 = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params1.gravity = Gravity.CENTER;
        frameLayout.setBackgroundColor(Color.RED);
        frameLayout.addView(textView1, params1);
        ViewGroup.LayoutParams behindParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
        behindParams.width = 300;
        setBehindContentView(frameLayout,behindParams);
    }
}
